<!DOCTYPE html>
<html>
<head>
<title>Promo client</title>
<meta name="viewport" charset="utf-8"
	content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- My style -->
<link href="../css/bootstrap.css" rel="stylesheet" media="screen">
<link href="../css/promos.css" rel="stylesheet">
</head>
<body>

	<div class="container">

		<div class="col-xs-19 col-md-3 ">
			<div class="panel panel-success">
			
						<?php
						require_once ("../services/ResponsableService.php");
						
						$responsableService = new ResponsableService ();
						
						$login = $_GET ["login"];
						$id_article = $_GET ["id"];
						$_SESSION ['article'] = $responsableService->getArticle ( $id_article );
						$promotion = $responsableService->getPromo ( $id_article );
						
						$client = $responsableService->getClient ( $login );
						$numClient = $client->getNumClient ();
						$numPromo = $promotion->getNumPromo ();
						$reponse = mysql_query ( "UPDATE `promo_client` SET `lu` = 1 where num_client = $numClient and num_promo = $numPromo" );
						
						$Article = $_SESSION ['article'];
						echo '			<div class="cnrflash">';
						echo '				<div class="cnrflash-inner">';
						echo '					<span class="cnrflash-label">' . $promotion->getPourcentagePromo () . '% <br> IMMEDIAT';
						echo '					</span>';
						echo '				</div>';
						echo '			</div>';
						echo '			<div class="panel-heading">';
						echo '				<h3 class="panel-title">' . $Article->getLibelle () . '</h3>';
						echo '			</div>';
						echo '			<div class="panel-body">';
						echo '				<table class="table">';
						echo '					<tr>';
						echo '						<td><img src="../img/' . $Article->getNumArticle () . '.jpg" width="95%" height="95%"';
						echo '							class="img-responsive voc_list_preview_img" alt="" title=""></td>';
						echo '					</tr>';
						echo '					<tr class="active">';
						echo '						<td>';
						echo '							<h2 style="margin-top: 5px;margin-bottom: -5px;color: #B40404;">';
						echo '								<strike>' . $Article->getPrixUnitaire () . ' &euro;</strike>';
						echo '							</h2>';
						echo '						</td>';
						echo '					</tr>';
						echo '					<tr>';
						echo '						<td>';
						$res = $Article->getPrixUnitaire () - $Article->getPrixUnitaire () * $promotion->getPourcentagePromo () / 100;
						echo '							<h2 style="margin-top: 4px;margin-bottom: -9px; color: #088A4B">' . number_format ( $res, 2 ) . ' &euro;</h2> <small >Nouveau prix !</small>';
						echo '						</td>';
						echo '					</tr>';
						echo '				</table>';
						echo '			</div>';
						echo '			<div class="panel-footer">';
						echo '				<a href="./client_localiser_promo.php?login=' . $login . '" class="btn btn-success" role="button">Localiser';
						echo '					</a><br /> <br /> <a href="./client_ne_plus_solliciter.php?login=' . $login . '"';
						echo '					class="btn btn-default panel-footer text-center" role="button"><span';
						echo '					class="glyphicon glyphicon-remove"></span> Ne plus me solliciter</a>';
						echo '			</div>';
						?>
			</div>
		</div>
		<center>
		<?php
		$login = $_GET ["login"];
		echo '	<div >';
		echo '			<a href="./client_notifications7.php?login=' . $login . '"';
		echo '			class="btn btn-default panel-footer text-center" role="button"><span';
		echo '			class="glyphicon glyphicon-chevron-left"></span> Précédent</a>';
		echo '	</div>';
		?>
		</center>
	</div>
</body>
<footer>
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="../js/bootstrap.js"></script>
</footer>
</html>